package jira;

import com.fasterxml.jackson.databind.node.JsonNodeFactory;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.apache.commons.codec.binary.Base64;

import java.io.*;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;

public class JiraTest {
    public static void main(String[] args) throws IOException {
        //获取项目信息
        String projectStr=JiraRestApiUtil.GetAction("/rest/api/2/project");
        System.out.println(projectStr);
//        //创建项目
//        JsonNodeFactory jnf = JsonNodeFactory.instance;
//        ObjectNode payload = jnf.objectNode();
//        {
//            //payload.put("notificationScheme", 10021);
//            payload.put("description", "Example Project description");
//            payload.put("lead", "admin");
//            payload.put("url", "http://atlassian.com");
//            payload.put("projectTemplateKey", "com.pyxis.greenhopper.jira:gh-scrum-template");
//            payload.put("avatarId", 10200);
//            //payload.put("issueSecurityScheme", 10001);
//            payload.put("name", "Example2");
//            //payload.put("permissionScheme", 10011);
//            //payload.put("assigneeType", "PROJECT_LEAD");
//            payload.put("projectTypeKey", "software");
//            payload.put("key", "EXE");
//            //payload.put("categoryId", 10120);
//        }
//        String createProject=JiraRestApiUtil.PostAction("/rest/api/2/project",payload);
//        System.out.println(createProject);
    }

}
